package com.kingsoft.dc.khaos.listener

/**
  * Created by chengguangqing on 2019/5/28.
  */
private[khaos] trait KhaosListenerBus
  extends ListenerBus[KhaosListener,KhaosListenerEvent]{
  override protected def doPostEvent(listener: KhaosListener,
                                     event: KhaosListenerEvent): Unit = {
    event match{
      case applicationStart: KhaosListenerApplicationStart =>
        listener.onApplicationStart(applicationStart)

      case applicationEnd:KhaosListenerApplicationEnd =>
        listener.onApplicationEnd(applicationEnd)

      case jobStart:KhaosListenerJobStart =>
        listener.onJobStart(jobStart)

      case jobEnd:KhaosListenerJobEnd =>
        listener.onJobEnd(jobEnd)

      case taskStart:KhaosListenerTaskStart =>
        listener.onTaskStart(taskStart)

      case taskEnd:KhaosListenerTaskEnd =>
        listener.onTaskEnd(taskEnd)
    }
  }
}
